package com.rss.view;

import com.rss.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Welcome extends Activity implements OnClickListener {
	private Button NSW;
	private Button VIC;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		findViews();
		setListeners();

	}

	private void setListeners() {
		VIC.setOnClickListener(this);
		NSW.setOnClickListener(this);
	}

	private void findViews() {
		VIC = (Button) this.findViewById(R.id.vicButton);
		NSW = (Button) this.findViewById(R.id.nswButton);
	}

	@Override
	public void onClick(View view) {
		Intent intent = new Intent(Welcome.this, RssReaderActivity.class);
		Bundle bundle = new Bundle();
		switch (view.getId()) {
		case R.id.vicButton:
			bundle.putString("location", "vic");
			break;
		case R.id.nswButton:
			bundle.putString("location", "nsw");
			break;
		default:
			bundle.putString("location", "vic");
		}
		intent.putExtras(bundle);
		startActivity(intent);

	}
	
}
